<template>
  <div>
    <div class="sidebar" >
      <el-menu
              :default-active="active"
              class="el-menu-vertical"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
      >
        <el-menu-item index="1">
          <i class="el-icon-s-home"></i>
          <span slot="title" @click="index">首页</span>
        </el-menu-item>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-notebook-2"></i>
            <span>新闻中心</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="1-1"  @click="goNews()">新闻列表</el-menu-item>
            <el-menu-item index="1-2" >数据统计</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span>账号中心</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="1-6" @click="goAdminCompany()" >注册的企业</el-menu-item>
            <el-menu-item index="1-7" @click="goAdminHrAccount()">HR账号</el-menu-item>
            <el-menu-item index="1-8" @click="goAdminUserAccount()">求职者账号</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-menu-item index="4" @click="goAdminPosition()">
          <i class="el-icon-monitor"></i>
          <span slot="title" >职位中心</span>
        </el-menu-item>
        <el-menu-item index="5" @click="goAdminJobFair()">
          <i class="el-icon-office-building"></i>
          <span slot="title" >招聘会中心</span>
        </el-menu-item>
      </el-menu>
    </div>
  </div>
</template>

<script>
  export default {
    name: "admin-menu",
    data() {
      return {
        active: "1"
      }
    },
    methods: {
      goNews(){
        this.$router.push("/adminWork/NewsList")
      },
      goAdminCompany(){
        this.$router.push("/adminWork/adminCompanyList")
      },
      goAdminHrAccount(){
        this.$router.push("/adminWork/adminHrAccount")
      },
      goAdminUserAccount(){
        this.$router.push("/adminWork/adminUserAccount")
      },
      goAdminPosition(){
        this.$router.push("/adminWork/adminPosition")
      },
      goAdminJobFair(){
        this.$router.push("/adminWork/adminJobFair")
      }
    }
  }
</script>

<style scoped>
  .el-menu-vertical {
    min-height: 600px;
  }

  .sidebar .btn_create {
    display: block;
    height: 45px;
    line-height: 45px;
    font-size: 18px;
    color: #fff;
    background: #91cebe url(img/icon_add.png) 45px center no-repeat;
    padding-left: 70px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    margin-bottom: 15px;
    -webkit-transition: .2s;
    -moz-transition: .2s;
    transition: .2s
  }

  .sidebar .btn_create:hover {
    color: #fff;
    background-color: #019875
  }
</style>